<template>
  <el-card class="box-card">
    <template #header>
      <div class="card-header">
        <span>导出角钢表格</span>
      </div>
    </template>
    <el-form ref="big_form3" :label-position=" 'right' " label-width="90px"
             :inline="true">
      <el-form-item label="选择日期">
        <el-date-picker
            v-model="cmy1"
            type="date"
            value-format="YYYY-MM-DD"
        />
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="table5()">导出销售用正品表</el-button>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="table6()">导出次品表</el-button>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="table7()">导出重量表</el-button>
      </el-form-item>
    </el-form>
  </el-card>

  <el-card class="box-card">
    <template #header>
      <div class="card-header">
        <span>导出带钢库存表</span>
      </div>
    </template>

    <el-form ref="big_form3" :label-position=" 'right' " label-width="90px"
             :inline="true">

      <el-form-item label="选择日期">
        <el-date-picker
            v-model="cmy2"
            type="date"
            value-format="YYYY-MM-DD"
        />
      </el-form-item>

      <el-form-item>
        <el-button type="primary" @click="table8()">导出带钢报表</el-button>
      </el-form-item>

    </el-form>
  </el-card>

  <el-card class="box-card">
    <template #header>
      <div class="card-header">
        <span>导出废品销售表</span>
      </div>
    </template>
    <el-form ref="big_form3" :label-position=" 'right' " label-width="90px"
             :inline="true">
      <el-form-item label="日期范围">
        <el-date-picker
            v-model="cmy3"
            type="daterange"
            range-separator="-"
            start-placeholder="开始日期"
            end-placeholder="开始日期"
            value-format="YYYY-MM-DD"
        />
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="table9()">导出废品销售表</el-button>
      </el-form-item>
    </el-form>
  </el-card>

</template>

<script setup lang="ts">
import {
  req_download_angle_steel_table_true_store,
  req_download_angle_steel_table_false_store, req_download_history_strip_steel_table,
  req_download_angle_steel_table_weight, req_download_scrap_steel_table
} from "@/api/inventory/export";
import {ref} from "vue";

const cmy1 = ref('')
const cmy2 = ref('')
const cmy3 = ref(['', ''])

const table5 = () => {
  req_download_angle_steel_table_true_store({export_date: cmy1.value})
}
const table6 = () => {
  req_download_angle_steel_table_false_store({export_date: cmy1.value})
}
const table7 = () => {
  req_download_angle_steel_table_weight({export_date: cmy1.value})
}
const table8 = () => {
  req_download_history_strip_steel_table({export_date: cmy2.value})
}
const table9 = () => {
  req_download_scrap_steel_table({export_date: cmy3.value as [string, string]})
}
</script>

<style scoped>

</style>
